//导入request.js
import request from '@/utils/request.js'

//活动列表
export const activityListService = (params) =>{
    return request.get('/activity/list',{params: params})
}

//发布活动
export const activityAddService = (activityData) => {
    return request.post('/activity/add', activityData)
}

//个人活动记录
export const listRecordsService  = () =>{
    return request.get('/activity/listRecords');
}

//过期活动记录
export const overdueRecordsService = () =>{
    return request.get('/activity/overdueRecords')
}

//删除活动记录
export const activityDelService = (delId) =>{
    return request.delete('/activity', {params: {id: delId}});
}

//报名活动
export const activityJoinService =(joinId) =>{
    return request.post('/activity/joinActivity?id='+joinId);
}

//报名的活动记录
export const myActivityListService = () => {
    return request.get('/activity/joinList');
}

//取消活动报名
export const activityCancelService = (delId)=>{
    return request.delete('/activity/cancel?id='+delId);
}

//根据活动id获得活动名
export const searchActivityName = (id)=>{
    return request.get('/activity/searchName?id='+id);
}